package com.huawei.appgallery.forum.posts.buoy.action;

import android.app.Activity;
import android.text.TextUtils;
import com.huawei.appgallery.assistantdock.base.externalaction.openviewaction.IOpenViewAction;
import com.huawei.appgallery.forum.posts.api.IPostDetailProtocol;
import com.huawei.secure.android.common.intent.SafeIntent;
import o.bqx;
import o.dys.a;
import o.fho;
import o.fiu;
import o.fjb;

public class OpenExpansionPostAction extends IOpenViewAction {
    public static final String ACTION_OPEN_FORUM_EXPANSION_POST = "com.huawei.gamebox.ACTION_OPEN_FORUM_EXPANSION_POST";
    public static final String BUNDLE_DOMAIN_ID = "DomainId";
    public static final String BUNDLE_IS_NEED_COMMENT = "IsNeedComment";
    public static final String BUNDLE_POST_DETAIL_ID = "PostDetailId";
    private static final String TAG = "OpenExpansionPostAction";

    public OpenExpansionPostAction(a aVar, SafeIntent safeIntent) {
        super(aVar, safeIntent);
    }

    public void onAction() {
        bqx.ˏ(TAG, "onAction");
        if (this.callback instanceof Activity) {
            startPost(this.intent.getStringExtra(BUNDLE_POST_DETAIL_ID), this.intent.getStringExtra("DomainId"), this.intent.getBooleanExtra(BUNDLE_IS_NEED_COMMENT, false));
        } else {
            bqx.ॱ(TAG, "!callback instanceof Activity");
        }
    }

    private void startPost(String str, String str2, boolean z) {
        if (!TextUtils.isEmpty(str)) {
            fjb ˎ = fho.ˏ().ˋ("Posts").ˎ("post.detail.activity");
            IPostDetailProtocol iPostDetailProtocol = (IPostDetailProtocol) ˎ.ˊ();
            iPostDetailProtocol.setUri(str);
            iPostDetailProtocol.setDomainId(str2);
            iPostDetailProtocol.setNeedComment(z);
            fiu.ˊ().ˏ((Activity) this.callback, ˎ);
        }
    }
}
